import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
//导入element-plus相关库导入
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
//element-plus暗黑模式主题
import 'element-plus/theme-chalk/dark/css-vars.css'
//导入项目全局css样式文件
import './style/global.scss'

//导入pinia
import pinia from "@/stores/index";

//创建一个应用
const app =  createApp(App)

//注册elementplus
app.use(ElementPlus, {
  locale: zhCn,
})
//注册elementplus-icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(router).mount('#app')
app.use(pinia)